/**
 * Created by ruiyuan on 15-8-11.
 */
module.exports = function (app) {
    var appController = require('../controllers/app-controller');

    //获取手机号状态
    app.get('/rest/' + RESTFullServiceVersion + '/app/mobilePhone/status/:mobilePhone/:deviceId', appController.getMobilePhoneStatus);

    //验证码 短信、语音、校验
    app.post('/rest/' + RESTFullServiceVersion + '/app/sms/verificationCode/:deviceId', appController.getSmsVerificationCode);
    /*  宝宝树66小区二期拼团    add  注册极验证 luolh  20170829   start  */
    app.post('/rest/' + RESTFullServiceVersion + '/app/sms/smsVerificationCodegee/:deviceId', appController.getSmsVerificationCodeGeetest);
    /*  宝宝树66小区二期拼团    add  注册极验证 luolh  20170829   end   */

    app.post('/rest/' + RESTFullServiceVersion + '/app/voice/verificationCode/:deviceId', appController.getVoiceVerificationCode);
    app.post('/rest/' + RESTFullServiceVersion + '/app/check/verificationCode/:deviceId', appController.checkVerificationCode);
    /*  宝宝树66小区二期拼团    add  注册极验证 luolh  20170821   start   */
    app.get('/rest/' + RESTFullServiceVersion + '/app/geetest/captchRegister/:deviceId', appController.captchRegister);
    app.post('/rest/' + RESTFullServiceVersion + '/app/geetest/captchValidate/:deviceId', appController.captchValidate);
    /*  宝宝树66小区二期拼团    add  注册极验证 luolh  20170821   end   */
    /*  宝宝树66小区二期拼团    add  登陆极验证 guo.xiaomin  20170919   start   */
    app.post('/rest/' + RESTFullServiceVersion + '/app/geetest/captchValidateLogin/:deviceId', appController.captchValidateLogin);
    /*  宝宝树66小区二期拼团    add  登陆极验证 guo.xiaomin  20170919   end   */

    /*  宝宝树66小区五期安全漏洞    add  登陆极验证 guo.xiaomin  20171116   start   */
    // 1120-commit-master
    app.get('/rest/' + RESTFullServiceVersion + '/app/geetest/captchRegisterNew/:deviceId/:token/:mobilePhone', appController.captchRegisterNew); // 注册,登陆，忘记密码一次验证
    app.post('/rest/' + RESTFullServiceVersion + '/app/geetest/captchValidateNew/:deviceId/:token/:mobilePhone', appController.captchValidateNew); // 注册,忘记密码,二次验证
    app.post('/rest/' + RESTFullServiceVersion + '/app/geetest/captchValidateLoginNew/:deviceId/:token/:mobilePhone', appController.captchValidateLoginNew); // 登陆二次验证
    app.post('/rest/' + RESTFullServiceVersion + '/app/sms/smsVerificationNew/:deviceId', appController.getSmsVerificationCodeGeetestNew); // 获取验证码
    app.post('/rest/' + RESTFullServiceVersion + '/app/resetPasswordNew/:deviceId', appController.resetPasswordNew); // 重置密码
    app.post('/rest/' + RESTFullServiceVersion + '/app/signUpNew/:deviceId', appController.signUpNew); // 注册
    /*  宝宝树66小区五期安全漏洞    add  登陆极验证 guo.xiaomin  20171116   end   */

    /*  宝宝树66小区五期安全漏洞-再次修改    add  登陆极验证 guo.xiaomin  20171206   start   */
    app.post('/rest/' + RESTFullServiceVersion + '/app/geetest/captchValidateRegisterNew/:deviceId/:token/:mobilePhone', appController.captchValidateRegisterNew); // 注册二次验证(最新版20171206)
    app.post('/rest/' + RESTFullServiceVersion + '/app/geetest/captchValidateAppLoginNew/:deviceId/:password/:token/:mobilePhone', appController.captchValidateAppLoginNew); // 登陆二次验证(最新版20171206)
    app.post('/rest/' + RESTFullServiceVersion + '/app/geetest/captchValidateAppLoginFinal/:deviceId/:token/:mobilePhone', appController.captchValidateAppLoginFinal); // 登陆二次验证(最新版20171212)
    /*  宝宝树66小区五期安全漏洞-再次修改    add  登陆极验证 guo.xiaomin  20171206   end   */

    //重置密码
    app.post('/rest/' + RESTFullServiceVersion + '/app/resetPassword/:deviceId', appController.resetPassword);

    //注册（设置密码和昵称）
    app.post('/rest/' + RESTFullServiceVersion + '/app/signUp/:deviceId', appController.signUp);
    /*  宝宝树66小区二次改造    add   llh  20170717   start   */
    //注册取得宝宝树已经注册的信息
    app.post('/rest/' + RESTFullServiceVersion + '/app/babyTreeRegisterUserInfo/:deviceId', appController.babyTreeRegisterUserInfo);
    /*  宝宝树66小区二次改造    add   llh  20170717   end   */

    //第三方绑定、登陆
    app.post('/rest/' + RESTFullServiceVersion + '/app/thirdParty/bind/:deviceId', appController.thirdPartyBind);
    app.post('/rest/' + RESTFullServiceVersion + '/app/thirdParty/login/:deviceId', appController.thirdPartyLogin);

    //城市、小区列表
    app.get('/rest/' + RESTFullServiceVersion + '/app/city/:lat/:lng/:token/:deviceId', appController.getCityList);

    app.get('/rest/' + RESTFullServiceVersion + '/app/hotCity/:lat/:lng/:token/:deviceId', appController.getHotCityList);

    app.get('/rest/' + RESTFullServiceVersion + '/app/community/:lat/:lng/:cityId/:page/:token/:deviceId', appController.getCommunityList);


    //小区搜索
    app.get('/rest/' + RESTFullServiceVersion + '/app/community/search/:lat/:lng/:cityId/:keyword/:token/:deviceId', appController.searchCommunity);

    //v认证  类型、提交资料
    app.get('/rest/' + RESTFullServiceVersion + '/app/verified/type/:token/:deviceId', appController.getVerifiedType);
    app.post('/rest/' + RESTFullServiceVersion + '/app/verified/profile/:token/:deviceId', appController.postVerifiedProfile);

    //定位认证
    app.post('/rest/' + RESTFullServiceVersion + '/app/verified/way/location/:token/:deviceId', appController.locationVerified);

    //我的邀请记录
    app.get('/rest/' + RESTFullServiceVersion + '/app/myInvitation/record/:page/:token/:deviceId', appController.getMyInvitationRecord);
    app.get('/rest/' + RESTFullServiceVersion + '/app/myInvitation/count/:token/:deviceId', appController.getMyInvitationCount);

    app.get('/rest/' + RESTFullServiceVersion + '/app/myInvitation/partRecord/:token/:deviceId', appController.getMyInvitationPartRecord);
    app.get('/rest/' + RESTFullServiceVersion + '/app/myInvitation/rank/:token/:deviceId', appController.getMyInvitationRank);

    //2.0签到
    app.get('/rest/' + RESTFullServiceVersion + '/app/user/signIn/:token/:deviceId', appController.userSignIn);

    /*  宝宝树66小区二次改造    add   guo.xiaomin  20170830   start   */
    // 抽奖成功
    app.get('/rest/' + RESTFullServiceVersion + '/app/user/luckDrawSuccess/:token/:deviceId', appController.userLuckDrawSuccess);
    /*  宝宝树66小区二次改造    add   guo.xiaomin  20170830   end   */

    //h5增量更新包
    app.get('/rest/' + RESTFullServiceVersion + '/app/marketZip/:version/:deviceId', appController.downloadMarketZip);

    //申请管理员、雷锋团
    app.post('/rest/' + RESTFullServiceVersion + '/app/userRole/apply/:token/:deviceId', appController.applyUserRole);

    //查询用户申请情况
    app.get('/rest/' + RESTFullServiceVersion + '/app/userRole/getUserRoleService/:type/:token/:deviceId', appController.getUserRoleService);

    app.post('/rest/' + RESTFullServiceVersion + '/app/contacts/invite/:token/:deviceId', appController.contactsInvite);

    app.get('/rest/' + RESTFullServiceVersion + '/app/splashScreen/:deviceId', appController.getSplashScreen);

    app.get('/rest/' + RESTFullServiceVersion + '/app/communityFounder/:deviceId', appController.getCommunityFounder);

    /* 宝宝树66小区二次改造 新老用户登录勾选最新版本用户协议 mod wangcan 20170927 start */
    app.post('/rest/' + RESTFullServiceVersion + '/app/check/checkProtocolVersion/:deviceId', appController.checkProtocolVersion);
    /* 宝宝树66小区二次改造 新老用户登录勾选最新版本用户协议 mod wangcan 20170927 end */
};
